package com.myway.dto.flight;

import com.myway.dto.flight.domain.SeasonType;
import com.myway.dto.order.domain.Inventory;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

//import com.hna.mars.service.extraproduct.dto.DTOServiceProduct;

/**
 * @类名称：DTOSegment 
 * @类描述：航班航段 
 * @创建时间：2015年11月11日 下午7:54:29 
 * @author Jiang.Yida
 * @version V1.0
 */
public class DTOSegment implements Serializable, Cloneable,
		Comparable<DTOSegment> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3771644749476529754L;

	private String carrier;
	private String flightNo;

	/**
	 * 机型
	 */
	private String aircraftStyle;

	/**
	 * 机场税 未使用
	 */
	private double airportTax;
	/**
	 * 到达时间
	 */
	private Date arriveTime;
	/**
	 * 
	 * 基础运价
	 */
	private double baseFare;
	/**
	 * 航班最低价
	 */
	private double lowestFare;
	/**
	 * 最低价舱位
	 */
	private String lowstCabin;
	/**
	 * "HH:mm"
	 */
	private Date departureTime;
	/**
	 *目的地
	 */
	private String destinationCity;
	/**
	 * 机场燃油 未使用
	 */
	private double fuelFee;

	/**
	 * 里程
	 */
	private double mileage;
	/**
	 * 出发地
	 * 
	 */
	private String originCity;

	/**
	 * 舱位
	 */
	private List<DTOCabin> cabins=new ArrayList<DTOCabin>();

	/**
	 * 库存类型
	 */
	private Inventory inventory = Inventory.IBE;

	/**
	 * stops: 经停 
	 */
	private int stops;

	/**
	 * stop_segs: 经停站信息 
	 */
	private List<DTOSegment> stop_segs;
	
	/**
	 * sequence: 航段序号 
	 * Sequence of this segment in the flight search. Start from 1. Ex: For
	 * return flight search, the first segment will have sequence = 1 and return
	 * segment will have sequence = 2
	 */
	private int sequence;

	/**
	 * 出发地机场
	 */
	private String orgAirport;
	/**
	 * 目的地机场
	 */
	private String dstAirport;

	/**
	 * 代码是否共享
	 */
	private boolean codeShare;
	
	/**
	 * seasonType: 销售季类型 
	 */
	private SeasonType seasonType;
	
	/**
	 * FareLock产品锁标示
	 */
	private Date lockTime;
	
	private double lockFee;
	/**
	 * 出发航站楼
	 */
	private String depTerm;
	/**
	 * 到达航站楼
	 */
	private String arriTerm;
	
	/**
	 * asr: 本航班是否支持座位预订功能,即ASR功能
	 */
	private boolean asr=false;
	/**
	 * meal: 是否有餐食
	 */
	private boolean meal=false;
//航段的辅营产品
//	private List<DTOServiceProduct> mealProductList  = new ArrayList<DTOServiceProduct>();
//	private List<DTOServiceProduct> yktProductList = new ArrayList<DTOServiceProduct>();
//	private List<DTOServiceProduct> luggageProductList = new ArrayList<DTOServiceProduct>();

	
	public Object clone() throws CloneNotSupportedException {
		return super.clone();
	}

	/**
	 * @return the aircraftStyle
	 */
	public String getAircraftStyle() {
		return this.aircraftStyle;
	}

	/**
	 * @param aircraftStyle
	 *            the aircraftStyle to set
	 */
	public void setAircraftStyle(String aircraftStyle) {
		this.aircraftStyle = aircraftStyle;
	}

	/**
	 * @return the airportTax
	 */
	public double getAirportTax() {
		return this.airportTax;
	}

	/**
	 * @param airportTax
	 *            the airportTax to set
	 */
	public void setAirportTax(double airportTax) {
		this.airportTax = airportTax;
	}

	/**
	 * @return the arriveTime
	 */
	public Date getArriveTime() {
		return this.arriveTime;
	}

	/**
	 * @param arriveTime
	 *            the arriveTime to set
	 */
	public void setArriveTime(Date arriveTime) {
		this.arriveTime = arriveTime;
	}

	/**
	 * @return the baseFare
	 */
	public double getBaseFare() {
		return this.baseFare;
	}

	/**
	 * @param baseFare
	 *            the baseFare to set
	 */
	public void setBaseFare(double baseFare) {
		this.baseFare = baseFare;
	}

	/**
	 * @return the departureTime
	 */
	public Date getDepartureTime() {
		return this.departureTime;
	}

	/**
	 * @param departureTime
	 *            the departureTime to set
	 */
	public void setDepartureTime(Date departureTime) {
		this.departureTime = departureTime;
	}

	/**
	 * @return the destinationCity
	 */
	public String getDestinationCity() {
		return this.destinationCity;
	}

	/**
	 * @param destinationCity
	 *            the destinationCity to set
	 */
	public void setDestinationCity(String destinationCity) {
		this.destinationCity = destinationCity;
	}

	/**
	 * @return the fuelFee
	 */
	public double getFuelFee() {
		return this.fuelFee;
	}

	/**
	 * @param fuelFee
	 *            the fuelFee to set
	 */
	public void setFuelFee(double fuelFee) {
		this.fuelFee = fuelFee;
	}

	/**
	 * @return the mileage
	 */
	public double getMileage() {
		return this.mileage;
	}

	/**
	 * @param mileage
	 *            the mileage to set
	 */
	public void setMileage(double mileage) {
		this.mileage = mileage;
	}

	/**
	 * @return the originCity
	 */
	public String getOriginCity() {
		return this.originCity;
	}

	/**
	 * @param originCity
	 *            the originCity to set
	 */
	public void setOriginCity(String originCity) {
		this.originCity = originCity;
	}

	/**
	 * @return the dTOCabins
	 */
	public List<DTOCabin> getCabins() {
		// System.out.println(this.getClass().getSimpleName() +
		// " - Getting all cabins for segment " + this.originCity + "-" +
		// this.destinationCity + " " + this.departureTime);
		return this.cabins;
	}

	/**
	 * @param cabins
	 *            the dTOCabins to set
	 */
	public void setCabins(List<DTOCabin> cabins) {
		this.cabins = cabins;
	}

	public String getCarrier() {
		return carrier;
	}

	public void setCarrier(String carrier) {
		this.carrier = carrier;
	}

	public String getFlightNo() {
		// System.out.println(this.getClass().getSimpleName() +
		// " - Getting flight number for segment " + this.originCity + "-" +
		// this.destinationCity + ": " + this.flightNo);
		return flightNo;
	}

	public void setFlightNo(String flightNo) {
		this.flightNo = flightNo;
	}

	/**
	 * @return the inventory
	 */
	public Inventory getInventory() {
		return this.inventory;
	}

	/**
	 * @param inventory
	 *            the inventory to set
	 */
	public void setInventory(Inventory inventory) {
		this.inventory = inventory;
	}

	/**
	 * @return the stops
	 */
	public int getStops() {
		return this.stops;
	}

	/**
	 * @param stops
	 *            the stops to set
	 */
	public void setStops(int stops) {
		this.stops = stops;
	}

	public int getSequence() {
		// System.out.println(this.getClass().getSimpleName() +
		// " - Getting sequence for segment " + this.originCity + "-" +
		// this.destinationCity + ": " + this.sequence);
		return sequence;
	}

	public void setSequence(int sequence) {
		this.sequence = sequence;
	}

	@Override
	public String toString() {
		StringBuffer buf = new StringBuffer();
		buf.append("[").append(getFlightNo()).append("]").append(" ").append(
				getOriginCity()).append("-").append(getDestinationCity())
				.append(" ").append(getDepartureTime());
		return buf.toString();
	}

	public int compareTo(DTOSegment otherSegment) {
		return this.sequence - otherSegment.getSequence();
	}

	/**
	 * @return the orgAirport
	 */
	public String getOrgAirport() {
		return orgAirport;
	}

	/**
	 * @param orgAirport
	 *            the orgAirport to set
	 */
	public void setOrgAirport(String orgAirport) {
		this.orgAirport = orgAirport;
	}

	/**
	 * @return the dstAirport
	 */
	public String getDstAirport() {
		return dstAirport;
	}

	/**
	 * @param dstAirport
	 *            the dstAirport to set
	 */
	public void setDstAirport(String dstAirport) {
		this.dstAirport = dstAirport;
	}

	/**
	 * @return the codeShare
	 */
	public boolean isCodeShare() {
		return codeShare;
	}

	/**
	 * @param codeShare
	 *            the codeShare to set
	 */
	public void setCodeShare(boolean codeShare) {
		this.codeShare = codeShare;
	}

	/**
	 * 
	 * @return seasontype
	 */
	public SeasonType getSeasonType() {
		return seasonType;
	}

	public void setSeasonType(SeasonType seasonType) {
		this.seasonType = seasonType;
	}

	public Date getLockTime() {
		return lockTime;
	}

	public void setLockTime(Date lockTime) {
		this.lockTime = lockTime;
	}

	public double getLockFee() {
		return lockFee;
	}

	public void setLockFee(double lockFee) {
		this.lockFee = lockFee;
	}

//	public List<DTOServiceProduct> getMealProductList() {
//		return mealProductList;
//	}
//
//	public void setMealProductList(List<DTOServiceProduct> mealProductList) {
//		this.mealProductList = mealProductList;
//	}
//
//	public List<DTOServiceProduct> getYktProductList() {
//		return yktProductList;
//	}
//
//	public void setYktProductList(List<DTOServiceProduct> yktProductList) {
//		this.yktProductList = yktProductList;
//	}
//
//	public List<DTOServiceProduct> getLuggageProductList() {
//		return luggageProductList;
//	}
//
//	public void setLuggageProductList(List<DTOServiceProduct> luggageProductList) {
//		this.luggageProductList = luggageProductList;
//	}

	public String getDepTerm() {
		return depTerm;
	}

	public void setDepTerm(String depTerm) {
		this.depTerm = depTerm;
	}

	public String getArriTerm() {
		return arriTerm;
	}

	public void setArriTerm(String arriTerm) {
		this.arriTerm = arriTerm;
	}

	public List<DTOSegment> getStop_segs() {
		return stop_segs;
	}

	public void setStop_segs(List<DTOSegment> stop_segs) {
		this.stop_segs = stop_segs;
	}

	public boolean isAsr() {
		return asr;
	}

	public void setAsr(boolean asr) {
		this.asr = asr;
	}

	public boolean isMeal() {
		return meal;
	}

	public void setMeal(boolean meal) {
		this.meal = meal;
	}

	public double getLowestFare() {
		return lowestFare;
	}

	public void setLowestFare(double lowestFare) {
		this.lowestFare = lowestFare;
	}

	public String getLowstCabin() {
		return lowstCabin;
	}

	public void setLowstCabin(String lowstCabin) {
		this.lowstCabin = lowstCabin;
	}
	
}